package com.heima.wemedia.controller.v1;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.dtos.ChannelDto;
import com.heima.model.wemedia.pojos.WmSensitive;
import com.heima.wemedia.service.WmSensitiveService;
import lombok.NoArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @program: heima-leadnews
 * @description:
 * @author: lydms
 * @create: 2024-04-11 10:18
 **/

@RestController
@RequestMapping("/api/v1/sensitive")

public class WmSensitiveController {

    @Autowired
    private WmSensitiveService wmSensitiveService;

    @PostMapping("/save")
    public ResponseResult insert(@RequestBody WmSensitive adSensitive){
        return wmSensitiveService.insert(adSensitive);
    }

    @PostMapping("/list")
    public ResponseResult pageList(@RequestBody ChannelDto channelDto){
        return wmSensitiveService.pageList(channelDto);
    }

    @PostMapping("/update")
    public ResponseResult updateSensitive(@RequestBody WmSensitive adSensitive){

        return wmSensitiveService.updateSensitive(adSensitive);
    }

    @DeleteMapping("/del/{id}")
    public ResponseResult deleteSensitive(@PathVariable("id") Integer id){
        return wmSensitiveService.deleteSensitive(id);
    }
}
